import UIKit

var fruits = ["apple"]
//插入一个元素
fruits.insert("banana", at: 1)
print(fruits)

//插入多个元素
fruits.insert(contentsOf: ["watermelon","orange"], at: 2)
print(fruits)

//插入一个区间
var n = [2,3,5]
n.insert(contentsOf: 6...9, at: n.count-1)
print(n)

//替换区间元素
n.replaceSubrange(0...2, with: [99,100])
print(n)

